<template>
  <div id="one-music" @click="jumpToMusicDetail(music.song_id)">
    <div id="one-music-img"><img :src="music.pic_small"></div>
    <div id="music-info">
      <span>{{music.title}}</span>
      <span>{{music.author}}・{{music.language}}</span>
    </div>
    <div id="go-in"> ></div>
  </div>
</template>

<script>
  export default {
    name: 'MusicHomeDetail.vue',
    props: ['music'],
    data() {
      return {
        msg: 'Welcome to Your Vue.js App'
      }
    },
    methods:{
      jumpToMusicDetail:function (id) {
        this.$router.push(`/song/${id}`)
      }
    }
  }
</script>
<style scoped>
  #one-music {
    height: 80px;
    width: calc(100% - 16px);
    margin: 0 auto;
    /*background-color: red;*/
    display: flex;
    align-items: center;
    position: relative;
    /*flex-wrap: wrap;*/
  }

  #one-music-img img {
    width: 60px;
    height: 60px;
    border-radius: 5px;
  }

  #music-info {
    /*flex: 3;*/
    display: flex;
    flex-direction: column;
    /*width: 70%;*/
    margin-left: 5px;
    width: 75%;
  }

  #music-info span:nth-child(1) {
    font-size: 14px;
  }

  #music-info span:nth-child(2) {
    font-size: 8px;
    margin-top: 5px;
    color: gray;
    white-space: nowrap;
    overflow: hidden;
  }

  #go-in {
    position: absolute;
    right: 0;
    color: gray;
    font-size: 12px;
  }

</style>
